<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
		<meta name="misapplication-tap-highlight" content="no" />
		<meta name="HandheldFriendly" content="true" />
		<meta name="MobileOptimized" content="320" />
		<!--<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">-->

		<title>课堂</title>

		<link rel="stylesheet" href="css/base.css" />
		<link rel="stylesheet" href="../css/mui.min.css">
		<script type="text/javascript" src="../js/mui.min.js"></script>
		<script src="..js/local-keys.js"></script>
		<script src="../js/utils.js"></script>
		<link rel="stylesheet" href="../css/classroom.css" />
	</head>

	<body>
		<style>
			.mui-control-content {
				background-color: white;
				min-height: 215px;
			}
			
			.mui-control-content .mui-loading {
				margin-top: 50px;
			}
			
			.mui-segmented-control.mui-segmented-control-inverted~.mui-slider-progress-bar {
			    background-color: #00D4C5;
			}
			
			.mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active{
				color: #00D4C5;
			}
			
			.mui-segmented-control{
				font-size: 20px;
			}
		</style>

		<div class="mui-content">
			<div id="slider" class="mui-slider">
				<div id="sliderSegmentedControl" class="mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
					
					<a class="mui-control-item"  href="#item1mobile">
						课堂
					</a>
					<a class="mui-control-item"  href="#item2mobile">
						回课
					</a>
					
					
				</div>
				<div id="sliderProgressBar" class="mui-slider-progress-bar mui-col-xs-6" ></div>
				<div class="mui-slider-group">
					<div id="item1mobile" class="mui-slider-item mui-control-content mui-active">
						<div id="scroll1" class="mui-scroll-wrapper">
							<div class="mui-scroll">
								
							</div>
						</div>
					</div>
					<div id="item2mobile" class="mui-slider-item mui-control-content">
						<div id="scroll2" class="mui-scroll-wrapper">
							<div class="mui-scroll">
								<div class="mui-loading">
									<div class="mui-spinner">
										
										
									</div>
								</div>
							</div>
						</div>

					</div>
					
				</div>
			</div>

		</div>
		<script src="../js/mui.min.js"></script>
		<script>
			mui.init({
				swipeBack: false
			});
			
			(function($) {
				$('.mui-scroll-wrapper').scroll({
					indicators: true //是否显示滚动条
				});
				 
				//加载初始化界面，来回刷新不会执行第二次
				mui("#item1mobile").load('classroom-2.html',function(){
					//mui('#item2mobile .mui-slider').slider();//手动初始化a元素内动态添加的轮播
				    printLog("2222222")
				});
				
				//var html2 = '<ul class="mui-table-view"><li class="mui-table-view-cell">第二个选项卡子项-1</li><li class="mui-table-view-cell">第二个选项卡子项-2</li><li class="mui-table-view-cell">第二个选项卡子项-3</li><li class="mui-table-view-cell">第二个选项卡子项-4</li><li class="mui-table-view-cell">第二个选项卡子项-5</li></ul>';
				//var html2 = "classroom-2.html";
				var item2 = document.getElementById('item2mobile');
				
				document.getElementById('slider').addEventListener('slide', function(e) {
					if(e.detail.slideNumber === 1) {
						if(item2.querySelector('.mui-loading')) {
							setTimeout(function() {
								//显示第二个布局的内容
								//item2.querySelector('.mui-scroll').innerHTML = html2;
							    
							    //可以将页面填充进这里
							   // mui('#item2mobile').load('classroom-2.html');
							   //只会执行一次
							   mui("#item2mobile").load('classroom-3.html',function(){
									//mui('#item2mobile .mui-slider').slider();//手动初始化a元素内动态添加的轮播
								    printLog("3333333333")
							    });
							    
							}, 500);
						}
					} 
				});
				
			})(mui);
		</script>

	</body>

</html>